﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Back/Shared/BackBBSSite.Master" 
Inherits="System.Web.Mvc.ViewPage<Wwtfly.BBS.BackModels.ViewModels.News.NewsShowsViewModel>" %>
<%@ Import Namespace="Wwtfly.Utility" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="grid_search">
     <%using (Html.BeginForm("Search"))
      {
            %>
    <ul>
        <li><span>新闻标题: </span><%= Html.TextBoxFor(model => model.NewsShowsSearch.NewsTitle)%></li>
        <li><span>新闻类型: </span><%=Html.DropDownListFor(model => model.NewsShowsSearch.TypeId, Model.NewTypesList, "请选择")%></li>
    </ul>
    <hr class="hr1" />
    <div>
    <div class="search_btn_content">
       <%=Html.HiddenFor(mc=>mc.NewsShows.NewsTitle) %>
        <%= Html.Submit("查询", "btn_submit",null) %>
        &nbsp;
        <%= Html.Button("重置", "btn_reset_search", new { name = "btn_reset_search" })%>
    </div>
    </div>
    <%} %>
</div>
<div class="clearfix"></div>
    <div class="grid_create tR">
    <p>
        <%= Html.ActionLink("创建", "Add", null, new { id = "btn_create" })%>
    </p>
    </div>
    <div class="grid_list">
    <table>
       <tr>
            <th>
                编号
            </th>
            <th  class="w100">
                新闻类型
            </th>
             <th >
                新闻标题
            </th>
            <th>
                设置关键词
            </th>
           
           <th class="w120">
                新闻时间
            </th>
            <th class="w60">
                关注数
            </th>
            <th>
                标签
            </th>
            <th class="w60">
                是否展示
            </th>
            <th class="w120">
                创建时间
            </th>
            <th class="w130">
                操作
            </th>
            
        </tr>

    <% foreach (var item in Model.NewsShowsPagedList) { %>
    
        <tr>
           
            <td class="tC">
                <%= Html.Encode(item.Id) %>
                <%=Html.CheckBox("cbKey", false, new { @class = "hidden" })%>
            </td>
            <td>
                <%= Html.Encode(item.TypeName)%>
            </td>
             <td>
            <span title="<%=Html.Encode(item.NewsTitle) %>">
            <%=Html.Encode(Wwtfly.Utility.ContentHelper.Substring(item.NewsTitle, 20, "...", 0))%></span>
            </td>
            <td>
                  <span title="<%=Html.Encode(item.Keyword) %>">
            <%=Html.Encode(ContentHelper.Substring(item.Keyword, 10, "...",0))%></span>
            </td>
            <td class="tC">
                <%= Html.Encode(String.Format("{0:g}", item.NewsInTime)) %>
            </td>
            <td class="tC">
                <%= Html.Encode(item.NewsClick) %>
            </td>
            <td>
                <%= Html.Encode(item.NewsTag) %>
            </td>
            <td class="tC">
                <%= ContentHelper.ConvertBoolState(item.NewsState)%> 
            </td>
            <td class="tC">
                <%= Html.Encode(String.Format("{0:g}", item.CreateTime)) %>
            </td>

             <td  class="tC">
                <%= Html.ActionLink("编辑", "Update", new { id = item.Id })%> |
                <%= Html.ActionLink("删除", "Delete", new { id = item.Id },
                           new { command = "delete" })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    </div>
    <div>
    <%=Html.Pager(this.Url,"Index",null) %>
    </div>
    

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">

//        $(document).ready(function () {
//            $("#NewsShows_NewsTitle").change(function () {
//                var index = document.getElementById("NewsShows_NewsTitle").selectedIndex;
//                var Text = document.getElementById("NewsShows_NewsTitle").options[index].text;
//                $("#NewsShows_NewsTitle").val(Text);
//            });

//        });
    
    </script>
</asp:Content>

